package P4;

import java.rmi.RemoteException;
import java.util.ArrayList;

public class Probe extends Thread{
	
	private ArrayList<Integer> 	transactionIDList;
	private ServerImpl 			originServer;
	private int 				transactionID;
	private int					lockOwner;
	
	public Probe(ArrayList<Integer> transactionIDList, ServerImpl originServer,	int transactionID, int lockOwner) {
		super();
		this.transactionIDList = transactionIDList;
		this.originServer = originServer;
		this.transactionID = transactionID;
		this.lockOwner = lockOwner;
	}
	
	public void run(){
		transactionIDList.add(transactionID);
		originServer.println("");
		try{
			originServer.getServer(lockOwner).edgeChasing(transactionIDList);
		}catch(RemoteException err){
			
		}
	}
}
